<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Voro++: cell.hh Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Voro++
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript" src="dynsections.js"></script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">cell.hh</div>  </div>
</div>
<div class="contents">
<a href="cell_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Voro++, a 3D cell-based Voronoi library</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Author   : Chris H. Rycroft (LBL / UC Berkeley)</span>
<a name="l00004"></a>00004 <span class="comment">// Email    : chr@alum.mit.edu</span>
<a name="l00005"></a>00005 <span class="comment">// Date     : August 30th 2011</span>
<a name="l00006"></a>00006 <span class="comment"></span>
<a name="l00007"></a>00007 <span class="comment">/** \file cell.hh</span>
<a name="l00008"></a>00008 <span class="comment"> * \brief Header file for the voronoicell and related classes. */</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef VOROPP_CELL_HH</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define VOROPP_CELL_HH</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;cstdio&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;cmath&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00017"></a>00017 <span class="keyword">using namespace </span>std;
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="config_8hh.html" title="Master configuration file for setting various compile-time options.">config.hh</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="common_8hh.html" title="Header file for the small helper functions.">common.hh</a>&quot;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="keyword">namespace </span>voro {
<a name="l00023"></a>00023 <span class="comment"></span>
<a name="l00024"></a>00024 <span class="comment">/** \brief A class representing a single Voronoi cell.</span>
<a name="l00025"></a>00025 <span class="comment"> *</span>
<a name="l00026"></a>00026 <span class="comment"> * This class represents a single Voronoi cell, as a collection of vertices</span>
<a name="l00027"></a>00027 <span class="comment"> * that are connected by edges. The class contains routines for initializing</span>
<a name="l00028"></a>00028 <span class="comment"> * the Voronoi cell to be simple shapes such as a box, tetrahedron, or octahedron.</span>
<a name="l00029"></a>00029 <span class="comment"> * It the contains routines for recomputing the cell based on cutting it</span>
<a name="l00030"></a>00030 <span class="comment"> * by a plane, which forms the key routine for the Voronoi cell computation.</span>
<a name="l00031"></a>00031 <span class="comment"> * It contains numerous routine for computing statistics about the Voronoi cell,</span>
<a name="l00032"></a>00032 <span class="comment"> * and it can output the cell in several formats.</span>
<a name="l00033"></a>00033 <span class="comment"> *</span>
<a name="l00034"></a>00034 <span class="comment"> * This class is not intended for direct use, but forms the base of the</span>
<a name="l00035"></a>00035 <span class="comment"> * voronoicell and voronoicell_neighbor classes, which extend it based on</span>
<a name="l00036"></a>00036 <span class="comment"> * whether neighboring particle ID information needs to be tracked. */</span>
<a name="l00037"></a><a class="code" href="classvoro_1_1voronoicell__base.html">00037</a> <span class="keyword">class </span><a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a> {
<a name="l00038"></a>00038         <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00039"></a>00039 <span class="comment">                /** This holds the current size of the arrays ed and nu, which</span>
<a name="l00040"></a>00040 <span class="comment">                 * hold the vertex information. If more vertices are created</span>
<a name="l00041"></a>00041 <span class="comment">                 * than can fit in this array, then it is dynamically extended</span>
<a name="l00042"></a>00042 <span class="comment">                 * using the add_memory_vertices routine. */</span>
<a name="l00043"></a><a class="code" href="classvoro_1_1voronoicell__base.html#ab0b624e4e72fca14c99bf1c41c430614">00043</a>                 <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#ab0b624e4e72fca14c99bf1c41c430614">current_vertices</a>;<span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">                /** This holds the current maximum allowed order of a vertex,</span>
<a name="l00045"></a>00045 <span class="comment">                 * which sets the size of the mem, mep, and mec arrays. If a</span>
<a name="l00046"></a>00046 <span class="comment">                 * vertex is created with more vertices than this, the arrays</span>
<a name="l00047"></a>00047 <span class="comment">                 * are dynamically extended using the add_memory_vorder routine.</span>
<a name="l00048"></a>00048 <span class="comment">                 */</span>
<a name="l00049"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a14c97918200da778388673728da29274">00049</a>                 <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a14c97918200da778388673728da29274">current_vertex_order</a>;<span class="comment"></span>
<a name="l00050"></a>00050 <span class="comment">                /** This sets the size of the main delete stack. */</span>
<a name="l00051"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a7dbec3b0b6ea24e22e651cf76f06dc04">00051</a>                 <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a7dbec3b0b6ea24e22e651cf76f06dc04">current_delete_size</a>;<span class="comment"></span>
<a name="l00052"></a>00052 <span class="comment">                /** This sets the size of the auxiliary delete stack. */</span>
<a name="l00053"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a2a238c710c2e91045ef9deae0faf8dc9">00053</a>                 <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a2a238c710c2e91045ef9deae0faf8dc9">current_delete2_size</a>;<span class="comment"></span>
<a name="l00054"></a>00054 <span class="comment">                /** This sets the total number of vertices in the current cell.</span>
<a name="l00055"></a>00055 <span class="comment">                 */</span>
<a name="l00056"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a7e69469f95464afbeb9feec927507243">00056</a>                 <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a7e69469f95464afbeb9feec927507243">p</a>;<span class="comment"></span>
<a name="l00057"></a>00057 <span class="comment">                /** This is the index of particular point in the cell, which is</span>
<a name="l00058"></a>00058 <span class="comment">                 * used to start the tracing routines for plane intersection</span>
<a name="l00059"></a>00059 <span class="comment">                 * and cutting. These routines will work starting from any</span>
<a name="l00060"></a>00060 <span class="comment">                 * point, but it&#39;s often most efficient to start from the last</span>
<a name="l00061"></a>00061 <span class="comment">                 * point considered, since in many cases, the cell construction</span>
<a name="l00062"></a>00062 <span class="comment">                 * algorithm may consider many planes with similar vectors</span>
<a name="l00063"></a>00063 <span class="comment">                 * concurrently. */</span>
<a name="l00064"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a7746d94ae036439d60c3e4a9e37f6d15">00064</a>                 <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a7746d94ae036439d60c3e4a9e37f6d15">up</a>;<span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">                /** This is a two dimensional array that holds information</span>
<a name="l00066"></a>00066 <span class="comment">                 * about the edge connections of the vertices that make up the</span>
<a name="l00067"></a>00067 <span class="comment">                 * cell. The two dimensional array is not allocated in the</span>
<a name="l00068"></a>00068 <span class="comment">                 * usual method. To account for the fact the different vertices</span>
<a name="l00069"></a>00069 <span class="comment">                 * have different orders, and thus require different amounts of</span>
<a name="l00070"></a>00070 <span class="comment">                 * storage, the elements of ed[i] point to one-dimensional</span>
<a name="l00071"></a>00071 <span class="comment">                 * arrays in the mep[] array of different sizes.</span>
<a name="l00072"></a>00072 <span class="comment">                 *</span>
<a name="l00073"></a>00073 <span class="comment">                 * More specifically, if vertex i has order m, then ed[i]</span>
<a name="l00074"></a>00074 <span class="comment">                 * points to a one-dimensional array in mep[m] that has 2*m+1</span>
<a name="l00075"></a>00075 <span class="comment">                 * entries. The first m elements hold the neighboring edges, so</span>
<a name="l00076"></a>00076 <span class="comment">                 * that the jth edge of vertex i is held in ed[i][j]. The next</span>
<a name="l00077"></a>00077 <span class="comment">                 * m elements hold a table of relations which is redundant but</span>
<a name="l00078"></a>00078 <span class="comment">                 * helps speed up the computation. It satisfies the relation</span>
<a name="l00079"></a>00079 <span class="comment">                 * ed[ed[i][j]][ed[i][m+j]]=i. The final entry holds a back</span>
<a name="l00080"></a>00080 <span class="comment">                 * pointer, so that ed[i+2*m]=i. The back pointers are used</span>
<a name="l00081"></a>00081 <span class="comment">                 * when rearranging the memory. */</span>
<a name="l00082"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a85fec05865342d7efca9d9fd11b60342">00082</a>                 <span class="keywordtype">int</span> **<a class="code" href="classvoro_1_1voronoicell__base.html#a85fec05865342d7efca9d9fd11b60342">ed</a>;<span class="comment"></span>
<a name="l00083"></a>00083 <span class="comment">                /** This array holds the order of the vertices in the Voronoi</span>
<a name="l00084"></a>00084 <span class="comment">                 * cell. This array is dynamically allocated, with its current</span>
<a name="l00085"></a>00085 <span class="comment">                 * size held by current_vertices. */</span>
<a name="l00086"></a><a class="code" href="classvoro_1_1voronoicell__base.html#abc7ec6777725e0ddffbbe2ecbe81c6a1">00086</a>                 <span class="keywordtype">int</span> *<a class="code" href="classvoro_1_1voronoicell__base.html#abc7ec6777725e0ddffbbe2ecbe81c6a1">nu</a>;<span class="comment"></span>
<a name="l00087"></a>00087 <span class="comment">                /** This in an array with size 3*current_vertices for holding</span>
<a name="l00088"></a>00088 <span class="comment">                 * the positions of the vertices. */</span>
<a name="l00089"></a><a class="code" href="classvoro_1_1voronoicell__base.html#aa4e3f22d4ff450097571e95caeda1b3d">00089</a>                 <span class="keywordtype">double</span> *<a class="code" href="classvoro_1_1voronoicell__base.html#aa4e3f22d4ff450097571e95caeda1b3d">pts</a>;
<a name="l00090"></a>00090                 <a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a>();
<a name="l00091"></a>00091                 ~<a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a>();
<a name="l00092"></a>00092                 <span class="keywordtype">void</span> init_base(<span class="keywordtype">double</span> xmin,<span class="keywordtype">double</span> xmax,<span class="keywordtype">double</span> ymin,<span class="keywordtype">double</span> ymax,<span class="keywordtype">double</span> zmin,<span class="keywordtype">double</span> zmax);
<a name="l00093"></a>00093                 <span class="keywordtype">void</span> init_octahedron_base(<span class="keywordtype">double</span> l);
<a name="l00094"></a>00094                 <span class="keywordtype">void</span> init_tetrahedron_base(<span class="keywordtype">double</span> x0,<span class="keywordtype">double</span> y0,<span class="keywordtype">double</span> z0,<span class="keywordtype">double</span> x1,<span class="keywordtype">double</span> y1,<span class="keywordtype">double</span> z1,<span class="keywordtype">double</span> x2,<span class="keywordtype">double</span> y2,<span class="keywordtype">double</span> z2,<span class="keywordtype">double</span> x3,<span class="keywordtype">double</span> y3,<span class="keywordtype">double</span> z3);
<a name="l00095"></a>00095                 <span class="keywordtype">void</span> translate(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z);
<a name="l00096"></a>00096                 <span class="keywordtype">void</span> draw_pov(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,FILE *fp=stdout);<span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment">                /** Outputs the cell in POV-Ray format, using cylinders for edges</span>
<a name="l00098"></a>00098 <span class="comment">                 * and spheres for vertices, to a given file.</span>
<a name="l00099"></a>00099 <span class="comment">                 * \param[in] (x,y,z) a displacement to add to the cell&#39;s</span>
<a name="l00100"></a>00100 <span class="comment">                 *                    position.</span>
<a name="l00101"></a>00101 <span class="comment">                 * \param[in] filename the name of the file to write to. */</span>
<a name="l00102"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a8138dc62fc6288c772b0483d0eb4eb96">00102</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a8138dc62fc6288c772b0483d0eb4eb96">draw_pov</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keyword">const</span> <span class="keywordtype">char</span> *filename) {
<a name="l00103"></a>00103                         FILE *fp=safe_fopen(filename,<span class="stringliteral">&quot;w&quot;</span>);
<a name="l00104"></a>00104                         draw_pov(x,y,z,fp);
<a name="l00105"></a>00105                         fclose(fp);
<a name="l00106"></a>00106                 };
<a name="l00107"></a>00107                 <span class="keywordtype">void</span> draw_pov_mesh(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,FILE *fp=stdout);<span class="comment"></span>
<a name="l00108"></a>00108 <span class="comment">                /** Outputs the cell in POV-Ray format as a mesh2 object to a</span>
<a name="l00109"></a>00109 <span class="comment">                 * given file.</span>
<a name="l00110"></a>00110 <span class="comment">                 * \param[in] (x,y,z) a displacement to add to the cell&#39;s</span>
<a name="l00111"></a>00111 <span class="comment">                 *                    position.</span>
<a name="l00112"></a>00112 <span class="comment">                 * \param[in] filename the name of the file to write to. */</span>
<a name="l00113"></a><a class="code" href="classvoro_1_1voronoicell__base.html#ac572b3e8ed428c12f38243b48bf39099">00113</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#ac572b3e8ed428c12f38243b48bf39099">draw_pov_mesh</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keyword">const</span> <span class="keywordtype">char</span> *filename) {
<a name="l00114"></a>00114                         FILE *fp=safe_fopen(filename,<span class="stringliteral">&quot;w&quot;</span>);
<a name="l00115"></a>00115                         draw_pov_mesh(x,y,z,fp);
<a name="l00116"></a>00116                         fclose(fp);
<a name="l00117"></a>00117                 }
<a name="l00118"></a>00118                 <span class="keywordtype">void</span> draw_gnuplot(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,FILE *fp=stdout);<span class="comment"></span>
<a name="l00119"></a>00119 <span class="comment">                /** Outputs the cell in Gnuplot format a given file.</span>
<a name="l00120"></a>00120 <span class="comment">                 * \param[in] (x,y,z) a displacement to add to the cell&#39;s</span>
<a name="l00121"></a>00121 <span class="comment">                 *                    position.</span>
<a name="l00122"></a>00122 <span class="comment">                 * \param[in] filename the name of the file to write to. */</span>
<a name="l00123"></a><a class="code" href="classvoro_1_1voronoicell__base.html#ac7cb75aa645c98107c9c0162fabf698e">00123</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#ac7cb75aa645c98107c9c0162fabf698e">draw_gnuplot</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keyword">const</span> <span class="keywordtype">char</span> *filename) {
<a name="l00124"></a>00124                         FILE *fp=safe_fopen(filename,<span class="stringliteral">&quot;w&quot;</span>);
<a name="l00125"></a>00125                         draw_gnuplot(x,y,z,fp);
<a name="l00126"></a>00126                         fclose(fp);
<a name="l00127"></a>00127                 }
<a name="l00128"></a>00128                 <span class="keywordtype">double</span> volume();
<a name="l00129"></a>00129                 <span class="keywordtype">double</span> max_radius_squared();
<a name="l00130"></a>00130                 <span class="keywordtype">double</span> total_edge_distance();
<a name="l00131"></a>00131                 <span class="keywordtype">double</span> surface_area();
<a name="l00132"></a>00132                 <span class="keywordtype">void</span> centroid(<span class="keywordtype">double</span> &amp;cx,<span class="keywordtype">double</span> &amp;cy,<span class="keywordtype">double</span> &amp;cz);
<a name="l00133"></a>00133                 <span class="keywordtype">int</span> number_of_faces();
<a name="l00134"></a>00134                 <span class="keywordtype">int</span> number_of_edges();
<a name="l00135"></a>00135                 <span class="keywordtype">void</span> vertex_orders(vector&lt;int&gt; &amp;v);
<a name="l00136"></a>00136                 <span class="keywordtype">void</span> output_vertex_orders(FILE *fp=stdout);
<a name="l00137"></a>00137                 <span class="keywordtype">void</span> vertices(vector&lt;double&gt; &amp;v);
<a name="l00138"></a>00138                 <span class="keywordtype">void</span> output_vertices(FILE *fp=stdout);
<a name="l00139"></a>00139                 <span class="keywordtype">void</span> vertices(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,vector&lt;double&gt; &amp;v);
<a name="l00140"></a>00140                 <span class="keywordtype">void</span> output_vertices(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,FILE *fp=stdout);
<a name="l00141"></a>00141                 <span class="keywordtype">void</span> face_areas(vector&lt;double&gt; &amp;v);<span class="comment"></span>
<a name="l00142"></a>00142 <span class="comment">                /** Outputs the areas of the faces.</span>
<a name="l00143"></a>00143 <span class="comment">                 * \param[in] fp the file handle to write to. */</span>
<a name="l00144"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a0492ecd057449172ca6d3993cb0661e4">00144</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a0492ecd057449172ca6d3993cb0661e4">output_face_areas</a>(FILE *fp=stdout) {
<a name="l00145"></a>00145                         vector&lt;double&gt; v;face_areas(v);
<a name="l00146"></a>00146                         voro_print_vector(v,fp);
<a name="l00147"></a>00147                 }
<a name="l00148"></a>00148                 <span class="keywordtype">void</span> face_orders(vector&lt;int&gt; &amp;v);<span class="comment"></span>
<a name="l00149"></a>00149 <span class="comment">                /** Outputs a list of the number of sides of each face.</span>
<a name="l00150"></a>00150 <span class="comment">                 * \param[in] fp the file handle to write to. */</span>
<a name="l00151"></a><a class="code" href="classvoro_1_1voronoicell__base.html#ad14069d3bebcda9353b07488f512800d">00151</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#ad14069d3bebcda9353b07488f512800d">output_face_orders</a>(FILE *fp=stdout) {
<a name="l00152"></a>00152                         vector&lt;int&gt; v;face_orders(v);
<a name="l00153"></a>00153                         voro_print_vector(v,fp);
<a name="l00154"></a>00154                 }
<a name="l00155"></a>00155                 <span class="keywordtype">void</span> face_freq_table(vector&lt;int&gt; &amp;v);<span class="comment"></span>
<a name="l00156"></a>00156 <span class="comment">                /** Outputs a */</span>
<a name="l00157"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a38929ec0787bb1acac5f1f7b9ec7cadf">00157</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a38929ec0787bb1acac5f1f7b9ec7cadf">output_face_freq_table</a>(FILE *fp=stdout) {
<a name="l00158"></a>00158                         vector&lt;int&gt; v;face_freq_table(v);
<a name="l00159"></a>00159                         voro_print_vector(v,fp);
<a name="l00160"></a>00160                 }
<a name="l00161"></a>00161                 <span class="keywordtype">void</span> face_vertices(vector&lt;int&gt; &amp;v);<span class="comment"></span>
<a name="l00162"></a>00162 <span class="comment">                /** Outputs the */</span>
<a name="l00163"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a67d6682dd62b76162f83822a17de6fe5">00163</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a67d6682dd62b76162f83822a17de6fe5">output_face_vertices</a>(FILE *fp=stdout) {
<a name="l00164"></a>00164                         vector&lt;int&gt; v;face_vertices(v);
<a name="l00165"></a>00165                         voro_print_face_vertices(v,fp);
<a name="l00166"></a>00166                 }
<a name="l00167"></a>00167                 <span class="keywordtype">void</span> face_perimeters(vector&lt;double&gt; &amp;v);<span class="comment"></span>
<a name="l00168"></a>00168 <span class="comment">                /** Outputs a list of the perimeters of each face.</span>
<a name="l00169"></a>00169 <span class="comment">                 * \param[in] fp the file handle to write to. */</span>
<a name="l00170"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a5dc3ae580a5f25424d50d4015aa878ba">00170</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a5dc3ae580a5f25424d50d4015aa878ba">output_face_perimeters</a>(FILE *fp=stdout) {
<a name="l00171"></a>00171                         vector&lt;double&gt; v;face_perimeters(v);
<a name="l00172"></a>00172                         voro_print_vector(v,fp);
<a name="l00173"></a>00173                 }
<a name="l00174"></a>00174                 <span class="keywordtype">void</span> normals(vector&lt;double&gt; &amp;v);<span class="comment"></span>
<a name="l00175"></a>00175 <span class="comment">                /** Outputs a list of the perimeters of each face.</span>
<a name="l00176"></a>00176 <span class="comment">                 * \param[in] fp the file handle to write to. */</span>
<a name="l00177"></a><a class="code" href="classvoro_1_1voronoicell__base.html#aae096d26d957c3e5b0f02b20d493a3ff">00177</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#aae096d26d957c3e5b0f02b20d493a3ff">output_normals</a>(FILE *fp=stdout) {
<a name="l00178"></a>00178                         vector&lt;double&gt; v;normals(v);
<a name="l00179"></a>00179                         voro_print_positions(v,fp);
<a name="l00180"></a>00180                 }<span class="comment"></span>
<a name="l00181"></a>00181 <span class="comment">                /** Outputs a custom string of information about the Voronoi</span>
<a name="l00182"></a>00182 <span class="comment">                 * cell to a file. It assumes the cell is at (0,0,0) and has a</span>
<a name="l00183"></a>00183 <span class="comment">                 * the default_radius associated with it.</span>
<a name="l00184"></a>00184 <span class="comment">                 * \param[in] format the custom format string to use.</span>
<a name="l00185"></a>00185 <span class="comment">                 * \param[in] fp the file handle to write to. */</span>
<a name="l00186"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a095c6bfc1b9b7a087d0b35b443e5c023">00186</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a095c6bfc1b9b7a087d0b35b443e5c023">output_custom</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *format,FILE *fp=stdout) {<a class="code" href="classvoro_1_1voronoicell__base.html#a095c6bfc1b9b7a087d0b35b443e5c023">output_custom</a>(format,0,0,0,0,default_radius,fp);}
<a name="l00187"></a>00187                 <span class="keywordtype">void</span> output_custom(<span class="keyword">const</span> <span class="keywordtype">char</span> *format,<span class="keywordtype">int</span> i,<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> r,FILE *fp=stdout);
<a name="l00188"></a>00188                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00189"></a>00189                 <span class="keywordtype">bool</span> nplane(vc_class &amp;vc,<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rs,<span class="keywordtype">int</span> p_id);
<a name="l00190"></a>00190                 <span class="keywordtype">bool</span> plane_intersects(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rs);
<a name="l00191"></a>00191                 <span class="keywordtype">bool</span> plane_intersects_guess(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rs);
<a name="l00192"></a>00192                 <span class="keywordtype">void</span> construct_relations();
<a name="l00193"></a>00193                 <span class="keywordtype">void</span> check_relations();
<a name="l00194"></a>00194                 <span class="keywordtype">void</span> check_duplicates();
<a name="l00195"></a>00195                 <span class="keywordtype">void</span> print_edges();<span class="comment"></span>
<a name="l00196"></a>00196 <span class="comment">                /** Returns a list of IDs of neighboring particles</span>
<a name="l00197"></a>00197 <span class="comment">                 * corresponding to each face.</span>
<a name="l00198"></a>00198 <span class="comment">                 * \param[out] v a reference to a vector in which to return the</span>
<a name="l00199"></a>00199 <span class="comment">                 *               results. If no neighbor information is</span>
<a name="l00200"></a>00200 <span class="comment">                 *               available, a blank vector is returned. */</span>
<a name="l00201"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a5d52bea0312e95ed77b82aeca10824b1">00201</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a5d52bea0312e95ed77b82aeca10824b1">neighbors</a>(vector&lt;int&gt; &amp;v) {v.clear();}<span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment">                /** This is a virtual function that is overridden by a routine</span>
<a name="l00203"></a>00203 <span class="comment">                 * to print a list of IDs of neighboring particles</span>
<a name="l00204"></a>00204 <span class="comment">                 * corresponding to each face. By default, when no neighbor</span>
<a name="l00205"></a>00205 <span class="comment">                 * information is available, the routine does nothing.</span>
<a name="l00206"></a>00206 <span class="comment">                 * \param[in] fp the file handle to write to. */</span>
<a name="l00207"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a99837f8d963c57c2c244518ba0ae4b8f">00207</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a99837f8d963c57c2c244518ba0ae4b8f">output_neighbors</a>(FILE *fp=stdout) {}<span class="comment"></span>
<a name="l00208"></a>00208 <span class="comment">                /** This a virtual function that is overridden by a routine to</span>
<a name="l00209"></a>00209 <span class="comment">                 * print the neighboring particle IDs for a given vertex. By</span>
<a name="l00210"></a>00210 <span class="comment">                 * default, when no neighbor information is available, the</span>
<a name="l00211"></a>00211 <span class="comment">                 * routine does nothing.</span>
<a name="l00212"></a>00212 <span class="comment">                 * \param[in] i the vertex to consider. */</span>
<a name="l00213"></a><a class="code" href="classvoro_1_1voronoicell__base.html#ac164b3767ce186360fb3308e349e058c">00213</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__base.html#ac164b3767ce186360fb3308e349e058c">print_edges_neighbors</a>(<span class="keywordtype">int</span> i) {};<span class="comment"></span>
<a name="l00214"></a>00214 <span class="comment">                /** This is a simple inline function for picking out the index</span>
<a name="l00215"></a>00215 <span class="comment">                 * of the next edge counterclockwise at the current vertex.</span>
<a name="l00216"></a>00216 <span class="comment">                 * \param[in] a the index of an edge of the current vertex.</span>
<a name="l00217"></a>00217 <span class="comment">                 * \param[in] p the number of the vertex.</span>
<a name="l00218"></a>00218 <span class="comment">                 * \return 0 if a=nu[p]-1, or a+1 otherwise. */</span>
<a name="l00219"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a1d86762311d8860960a45cc409b14f0f">00219</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#a1d86762311d8860960a45cc409b14f0f">cycle_up</a>(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> p) {<span class="keywordflow">return</span> a==nu[p]-1?0:a+1;}<span class="comment"></span>
<a name="l00220"></a>00220 <span class="comment">                /** This is a simple inline function for picking out the index</span>
<a name="l00221"></a>00221 <span class="comment">                 * of the next edge clockwise from the current vertex.</span>
<a name="l00222"></a>00222 <span class="comment">                 * \param[in] a the index of an edge of the current vertex.</span>
<a name="l00223"></a>00223 <span class="comment">                 * \param[in] p the number of the vertex.</span>
<a name="l00224"></a>00224 <span class="comment">                 * \return nu[p]-1 if a=0, or a-1 otherwise. */</span>
<a name="l00225"></a><a class="code" href="classvoro_1_1voronoicell__base.html#adfccfa7dce395277535f61f780d87c8b">00225</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classvoro_1_1voronoicell__base.html#adfccfa7dce395277535f61f780d87c8b">cycle_down</a>(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> p) {<span class="keywordflow">return</span> a==0?nu[p]-1:a-1;}
<a name="l00226"></a>00226         <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment">                /** This a one dimensional array that holds the current sizes</span>
<a name="l00228"></a>00228 <span class="comment">                 * of the memory allocations for them mep array.*/</span>
<a name="l00229"></a><a class="code" href="classvoro_1_1voronoicell__base.html#aafad86ca11af64de2788637b466479f6">00229</a>                 <span class="keywordtype">int</span> *<a class="code" href="classvoro_1_1voronoicell__base.html#aafad86ca11af64de2788637b466479f6">mem</a>;<span class="comment"></span>
<a name="l00230"></a>00230 <span class="comment">                /** This is a one dimensional array that holds the current</span>
<a name="l00231"></a>00231 <span class="comment">                 * number of vertices of order p that are stored in the mep[p]</span>
<a name="l00232"></a>00232 <span class="comment">                 * array. */</span>
<a name="l00233"></a><a class="code" href="classvoro_1_1voronoicell__base.html#accebb51f721d72fc6d460f1368180571">00233</a>                 <span class="keywordtype">int</span> *<a class="code" href="classvoro_1_1voronoicell__base.html#accebb51f721d72fc6d460f1368180571">mec</a>;<span class="comment"></span>
<a name="l00234"></a>00234 <span class="comment">                /** This is a two dimensional array for holding the information</span>
<a name="l00235"></a>00235 <span class="comment">                 * about the edges of the Voronoi cell. mep[p] is a</span>
<a name="l00236"></a>00236 <span class="comment">                 * one-dimensional array for holding the edge information about</span>
<a name="l00237"></a>00237 <span class="comment">                 * all vertices of order p, with each vertex holding 2*p+1</span>
<a name="l00238"></a>00238 <span class="comment">                 * integers of information. The total number of vertices held</span>
<a name="l00239"></a>00239 <span class="comment">                 * on mep[p] is stored in mem[p]. If the space runs out, the</span>
<a name="l00240"></a>00240 <span class="comment">                 * code allocates more using the add_memory() routine. */</span>
<a name="l00241"></a><a class="code" href="classvoro_1_1voronoicell__base.html#a2b115cbde725e468000a1da234b2fc66">00241</a>                 <span class="keywordtype">int</span> **<a class="code" href="classvoro_1_1voronoicell__base.html#a2b115cbde725e468000a1da234b2fc66">mep</a>;
<a name="l00242"></a>00242                 <span class="keyword">inline</span> <span class="keywordtype">void</span> reset_edges();
<a name="l00243"></a>00243                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00244"></a>00244                 <span class="keywordtype">void</span> check_memory_for_copy(vc_class &amp;vc,<a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a>* vb);
<a name="l00245"></a>00245                 <span class="keywordtype">void</span> copy(<a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a>* vb);
<a name="l00246"></a>00246         <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00247"></a>00247 <span class="comment">                /** This is the delete stack, used to store the vertices which</span>
<a name="l00248"></a>00248 <span class="comment">                 * are going to be deleted during the plane cutting procedure.</span>
<a name="l00249"></a>00249 <span class="comment">                 */</span>
<a name="l00250"></a>00250                 <span class="keywordtype">int</span> *ds,*stacke;<span class="comment"></span>
<a name="l00251"></a>00251 <span class="comment">                /** This is the auxiliary delete stack, which has size set by</span>
<a name="l00252"></a>00252 <span class="comment">                 * current_delete2_size. */</span>
<a name="l00253"></a>00253                 <span class="keywordtype">int</span> *ds2,*stacke2;<span class="comment"></span>
<a name="l00254"></a>00254 <span class="comment">                /** This stores the current memory allocation for the marginal</span>
<a name="l00255"></a>00255 <span class="comment">                 * cases. */</span>
<a name="l00256"></a>00256                 <span class="keywordtype">int</span> current_marginal;<span class="comment"></span>
<a name="l00257"></a>00257 <span class="comment">                /** This stores the total number of marginal points which are</span>
<a name="l00258"></a>00258 <span class="comment">                 * currently in the buffer. */</span>
<a name="l00259"></a>00259                 <span class="keywordtype">int</span> n_marg;<span class="comment"></span>
<a name="l00260"></a>00260 <span class="comment">                /** This array contains a list of the marginal points, and also</span>
<a name="l00261"></a>00261 <span class="comment">                 * the outcomes of the marginal tests. */</span>
<a name="l00262"></a>00262                 <span class="keywordtype">int</span> *marg;<span class="comment"></span>
<a name="l00263"></a>00263 <span class="comment">                /** The x coordinate of the normal vector to the test plane. */</span>
<a name="l00264"></a>00264                 <span class="keywordtype">double</span> px;<span class="comment"></span>
<a name="l00265"></a>00265 <span class="comment">                /** The y coordinate of the normal vector to the test plane. */</span>
<a name="l00266"></a>00266                 <span class="keywordtype">double</span> py;<span class="comment"></span>
<a name="l00267"></a>00267 <span class="comment">                /** The z coordinate of the normal vector to the test plane. */</span>
<a name="l00268"></a>00268                 <span class="keywordtype">double</span> pz;<span class="comment"></span>
<a name="l00269"></a>00269 <span class="comment">                /** The magnitude of the normal vector to the test plane. */</span>
<a name="l00270"></a>00270                 <span class="keywordtype">double</span> prsq;
<a name="l00271"></a>00271                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00272"></a>00272                 <span class="keywordtype">void</span> add_memory(vc_class &amp;vc,<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> *stackp2);
<a name="l00273"></a>00273                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00274"></a>00274                 <span class="keywordtype">void</span> add_memory_vertices(vc_class &amp;vc);
<a name="l00275"></a>00275                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00276"></a>00276                 <span class="keywordtype">void</span> add_memory_vorder(vc_class &amp;vc);
<a name="l00277"></a>00277                 <span class="keywordtype">void</span> add_memory_ds(<span class="keywordtype">int</span> *&amp;stackp);
<a name="l00278"></a>00278                 <span class="keywordtype">void</span> add_memory_ds2(<span class="keywordtype">int</span> *&amp;stackp2);
<a name="l00279"></a>00279                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00280"></a>00280                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> collapse_order1(vc_class &amp;vc);
<a name="l00281"></a>00281                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00282"></a>00282                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> collapse_order2(vc_class &amp;vc);
<a name="l00283"></a>00283                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00284"></a>00284                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> delete_connection(vc_class &amp;vc,<span class="keywordtype">int</span> j,<span class="keywordtype">int</span> k,<span class="keywordtype">bool</span> hand);
<a name="l00285"></a>00285                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00286"></a>00286                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> search_for_outside_edge(vc_class &amp;vc,<span class="keywordtype">int</span> &amp;up);
<a name="l00287"></a>00287                 <span class="keyword">template</span>&lt;<span class="keyword">class</span> vc_<span class="keyword">class</span>&gt;
<a name="l00288"></a>00288                 <span class="keyword">inline</span> <span class="keywordtype">void</span> add_to_stack(vc_class &amp;vc,<span class="keywordtype">int</span> lp,<span class="keywordtype">int</span> *&amp;stackp2);
<a name="l00289"></a>00289                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> plane_intersects_track(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rs,<span class="keywordtype">double</span> g);
<a name="l00290"></a>00290                 <span class="keyword">inline</span> <span class="keywordtype">void</span> normals_search(vector&lt;double&gt; &amp;v,<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> j,<span class="keywordtype">int</span> k);
<a name="l00291"></a>00291                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> search_edge(<span class="keywordtype">int</span> l,<span class="keywordtype">int</span> &amp;m,<span class="keywordtype">int</span> &amp;k);
<a name="l00292"></a>00292                 <span class="keyword">inline</span> <span class="keywordtype">int</span> m_test(<span class="keywordtype">int</span> n,<span class="keywordtype">double</span> &amp;ans);
<a name="l00293"></a>00293                 <span class="keywordtype">int</span> check_marginal(<span class="keywordtype">int</span> n,<span class="keywordtype">double</span> &amp;ans);
<a name="l00294"></a>00294                 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a>;
<a name="l00295"></a>00295                 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a>;
<a name="l00296"></a>00296 };
<a name="l00297"></a>00297 <span class="comment"></span>
<a name="l00298"></a>00298 <span class="comment">/** \brief Extension of the voronoicell_base class to represent a Voronoi</span>
<a name="l00299"></a>00299 <span class="comment"> * cell without neighbor information.</span>
<a name="l00300"></a>00300 <span class="comment"> *</span>
<a name="l00301"></a>00301 <span class="comment"> * This class is an extension of the voronoicell_base class, in cases when</span>
<a name="l00302"></a>00302 <span class="comment"> * is not necessary to track the IDs of neighboring particles associated</span>
<a name="l00303"></a>00303 <span class="comment"> * with each face of the Voronoi cell. */</span>
<a name="l00304"></a><a class="code" href="classvoro_1_1voronoicell.html">00304</a> <span class="keyword">class </span><a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> : <span class="keyword">public</span> <a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a> {
<a name="l00305"></a>00305         <span class="keyword">public</span>:
<a name="l00306"></a>00306                 <span class="keyword">using</span> voronoicell_base::nplane;<span class="comment"></span>
<a name="l00307"></a>00307 <span class="comment">                /** Copies the information from another voronoicell class into</span>
<a name="l00308"></a>00308 <span class="comment">                 * this class, extending memory allocation if necessary.</span>
<a name="l00309"></a>00309 <span class="comment">                 * \param[in] c the class to copy. */</span>
<a name="l00310"></a><a class="code" href="classvoro_1_1voronoicell.html#a00ff7480ad31fbf06dcca83cb0683e68">00310</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell.html#a00ff7480ad31fbf06dcca83cb0683e68">operator=</a>(<a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> &amp;c) {
<a name="l00311"></a>00311                         <a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a>* vb((<a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a>*) &amp;c);
<a name="l00312"></a>00312                         check_memory_for_copy(*<span class="keyword">this</span>,vb);copy(vb);
<a name="l00313"></a>00313                 }<span class="comment"></span>
<a name="l00314"></a>00314 <span class="comment">                /** Cuts a Voronoi cell using by the plane corresponding to the</span>
<a name="l00315"></a>00315 <span class="comment">                 * perpendicular bisector of a particle.</span>
<a name="l00316"></a>00316 <span class="comment">                 * \param[in] (x,y,z) the position of the particle.</span>
<a name="l00317"></a>00317 <span class="comment">                 * \param[in] rsq the modulus squared of the vector.</span>
<a name="l00318"></a>00318 <span class="comment">                 * \param[in] p_id the plane ID, ignored for this case where no</span>
<a name="l00319"></a>00319 <span class="comment">                 *                 neighbor tracking is enabled.</span>
<a name="l00320"></a>00320 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00321"></a>00321 <span class="comment">                 *         true otherwise. */</span>
<a name="l00322"></a><a class="code" href="classvoro_1_1voronoicell.html#a9918d33d62ce9afaff9ed8549ff637f9">00322</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell.html#a9918d33d62ce9afaff9ed8549ff637f9">nplane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rsq,<span class="keywordtype">int</span> p_id) {
<a name="l00323"></a>00323                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,0);
<a name="l00324"></a>00324                 }<span class="comment"></span>
<a name="l00325"></a>00325 <span class="comment">                /** Cuts a Voronoi cell using by the plane corresponding to the</span>
<a name="l00326"></a>00326 <span class="comment">                 * perpendicular bisector of a particle.</span>
<a name="l00327"></a>00327 <span class="comment">                 * \param[in] (x,y,z) the position of the particle.</span>
<a name="l00328"></a>00328 <span class="comment">                 * \param[in] p_id the plane ID, ignored for this case where no</span>
<a name="l00329"></a>00329 <span class="comment">                 *                 neighbor tracking is enabled.</span>
<a name="l00330"></a>00330 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00331"></a>00331 <span class="comment">                 *         true otherwise. */</span>
<a name="l00332"></a><a class="code" href="classvoro_1_1voronoicell.html#a3f334a0d45c764677418ded3687f005a">00332</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell.html#a3f334a0d45c764677418ded3687f005a">nplane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">int</span> p_id) {
<a name="l00333"></a>00333                         <span class="keywordtype">double</span> rsq=x*x+y*y+z*z;
<a name="l00334"></a>00334                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,0);
<a name="l00335"></a>00335                 }<span class="comment"></span>
<a name="l00336"></a>00336 <span class="comment">                /** Cuts a Voronoi cell using by the plane corresponding to the</span>
<a name="l00337"></a>00337 <span class="comment">                 * perpendicular bisector of a particle.</span>
<a name="l00338"></a>00338 <span class="comment">                 * \param[in] (x,y,z) the position of the particle.</span>
<a name="l00339"></a>00339 <span class="comment">                 * \param[in] rsq the modulus squared of the vector.</span>
<a name="l00340"></a>00340 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00341"></a>00341 <span class="comment">                 *         true otherwise. */</span>
<a name="l00342"></a><a class="code" href="classvoro_1_1voronoicell.html#a6e95394d82fd835c75a77462c872594e">00342</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell.html#a6e95394d82fd835c75a77462c872594e">plane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rsq) {
<a name="l00343"></a>00343                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,0);
<a name="l00344"></a>00344                 }<span class="comment"></span>
<a name="l00345"></a>00345 <span class="comment">                /** Cuts a Voronoi cell using by the plane corresponding to the</span>
<a name="l00346"></a>00346 <span class="comment">                 * perpendicular bisector of a particle.</span>
<a name="l00347"></a>00347 <span class="comment">                 * \param[in] (x,y,z) the position of the particle.</span>
<a name="l00348"></a>00348 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00349"></a>00349 <span class="comment">                 *         true otherwise. */</span>
<a name="l00350"></a><a class="code" href="classvoro_1_1voronoicell.html#ac2273c14b7bcc02696be10d9249670c0">00350</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell.html#ac2273c14b7bcc02696be10d9249670c0">plane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z) {
<a name="l00351"></a>00351                         <span class="keywordtype">double</span> rsq=x*x+y*y+z*z;
<a name="l00352"></a>00352                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,0);
<a name="l00353"></a>00353                 }<span class="comment"></span>
<a name="l00354"></a>00354 <span class="comment">                /** Initializes the Voronoi cell to be rectangular box with the</span>
<a name="l00355"></a>00355 <span class="comment">                 * given dimensions.</span>
<a name="l00356"></a>00356 <span class="comment">                 * \param[in] (xmin,xmax) the minimum and maximum x coordinates.</span>
<a name="l00357"></a>00357 <span class="comment">                 * \param[in] (ymin,ymax) the minimum and maximum y coordinates.</span>
<a name="l00358"></a>00358 <span class="comment">                 * \param[in] (zmin,zmax) the minimum and maximum z coordinates. */</span>
<a name="l00359"></a><a class="code" href="classvoro_1_1voronoicell.html#a573257366d690af4fd8646b4c431ca84">00359</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell.html#a573257366d690af4fd8646b4c431ca84">init</a>(<span class="keywordtype">double</span> xmin,<span class="keywordtype">double</span> xmax,<span class="keywordtype">double</span> ymin,<span class="keywordtype">double</span> ymax,<span class="keywordtype">double</span> zmin,<span class="keywordtype">double</span> zmax) {
<a name="l00360"></a>00360                         init_base(xmin,xmax,ymin,ymax,zmin,zmax);
<a name="l00361"></a>00361                 }<span class="comment"></span>
<a name="l00362"></a>00362 <span class="comment">                /** Initializes the cell to be an octahedron with vertices at</span>
<a name="l00363"></a>00363 <span class="comment">                 * (l,0,0), (-l,0,0), (0,l,0), (0,-l,0), (0,0,l), and (0,0,-l).</span>
<a name="l00364"></a>00364 <span class="comment">                 * \param[in] l a parameter setting the size of the octahedron.</span>
<a name="l00365"></a>00365 <span class="comment">                 */</span>
<a name="l00366"></a><a class="code" href="classvoro_1_1voronoicell.html#a10e64245beac741327913dbe25a6abc9">00366</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell.html#a10e64245beac741327913dbe25a6abc9">init_octahedron</a>(<span class="keywordtype">double</span> l) {
<a name="l00367"></a>00367                         init_octahedron_base(l);
<a name="l00368"></a>00368                 }<span class="comment"></span>
<a name="l00369"></a>00369 <span class="comment">                /** Initializes the cell to be a tetrahedron.</span>
<a name="l00370"></a>00370 <span class="comment">                 * \param[in] (x0,y0,z0) the coordinates of the first vertex.</span>
<a name="l00371"></a>00371 <span class="comment">                 * \param[in] (x1,y1,z1) the coordinates of the second vertex.</span>
<a name="l00372"></a>00372 <span class="comment">                 * \param[in] (x2,y2,z2) the coordinates of the third vertex.</span>
<a name="l00373"></a>00373 <span class="comment">                 * \param[in] (x3,y3,z3) the coordinates of the fourth vertex.</span>
<a name="l00374"></a>00374 <span class="comment">                 */</span>
<a name="l00375"></a><a class="code" href="classvoro_1_1voronoicell.html#a63e460f0fdabffedd31c0e90a26ec169">00375</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell.html#a63e460f0fdabffedd31c0e90a26ec169">init_tetrahedron</a>(<span class="keywordtype">double</span> x0,<span class="keywordtype">double</span> y0,<span class="keywordtype">double</span> z0,<span class="keywordtype">double</span> x1,<span class="keywordtype">double</span> y1,<span class="keywordtype">double</span> z1,<span class="keywordtype">double</span> x2,<span class="keywordtype">double</span> y2,<span class="keywordtype">double</span> z2,<span class="keywordtype">double</span> x3,<span class="keywordtype">double</span> y3,<span class="keywordtype">double</span> z3) {
<a name="l00376"></a>00376                         init_tetrahedron_base(x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3);
<a name="l00377"></a>00377                 }
<a name="l00378"></a>00378         <span class="keyword">private</span>:
<a name="l00379"></a>00379                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_allocate(<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> m) {};
<a name="l00380"></a>00380                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_add_memory_vertices(<span class="keywordtype">int</span> i) {};
<a name="l00381"></a>00381                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_add_memory_vorder(<span class="keywordtype">int</span> i) {};
<a name="l00382"></a>00382                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_pointer(<span class="keywordtype">int</span> p,<span class="keywordtype">int</span> n) {};
<a name="l00383"></a>00383                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b,<span class="keywordtype">int</span> c,<span class="keywordtype">int</span> d) {};
<a name="l00384"></a>00384                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b,<span class="keywordtype">int</span> c) {};
<a name="l00385"></a>00385                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_aux1(<span class="keywordtype">int</span> k) {};
<a name="l00386"></a>00386                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_aux1(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {};
<a name="l00387"></a>00387                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_aux1_shift(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {};
<a name="l00388"></a>00388                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_aux2_copy(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {};
<a name="l00389"></a>00389                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_pointer(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {};
<a name="l00390"></a>00390                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_to_aux1(<span class="keywordtype">int</span> j) {};
<a name="l00391"></a>00391                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_to_aux2(<span class="keywordtype">int</span> j) {};
<a name="l00392"></a>00392                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_allocate_aux1(<span class="keywordtype">int</span> i) {};
<a name="l00393"></a>00393                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_switch_to_aux1(<span class="keywordtype">int</span> i) {};
<a name="l00394"></a>00394                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_to_aux1(<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> m) {};
<a name="l00395"></a>00395                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_to_aux1_offset(<span class="keywordtype">int</span> k,<span class="keywordtype">int</span> m) {};
<a name="l00396"></a>00396                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_neighbors(vector&lt;int&gt; &amp;v) {v.clear();};
<a name="l00397"></a>00397                 <span class="keyword">friend</span> <span class="keyword">class </span>voronoicell_base;
<a name="l00398"></a>00398 };
<a name="l00399"></a>00399 <span class="comment"></span>
<a name="l00400"></a>00400 <span class="comment">/** \brief Extension of the voronoicell_base class to represent a Voronoi cell</span>
<a name="l00401"></a>00401 <span class="comment"> * with neighbor information.</span>
<a name="l00402"></a>00402 <span class="comment"> *</span>
<a name="l00403"></a>00403 <span class="comment"> * This class is an extension of the voronoicell_base class, in cases when the</span>
<a name="l00404"></a>00404 <span class="comment"> * IDs of neighboring particles associated with each face of the Voronoi cell.</span>
<a name="l00405"></a>00405 <span class="comment"> * It contains additional data structures mne and ne for storing this</span>
<a name="l00406"></a>00406 <span class="comment"> * information. */</span>
<a name="l00407"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html">00407</a> <span class="keyword">class </span><a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a> : <span class="keyword">public</span> <a class="code" href="classvoro_1_1voronoicell__base.html" title="A class representing a single Voronoi cell.">voronoicell_base</a> {
<a name="l00408"></a>00408         <span class="keyword">public</span>:
<a name="l00409"></a>00409                 <span class="keyword">using</span> voronoicell_base::nplane;<span class="comment"></span>
<a name="l00410"></a>00410 <span class="comment">                /** This two dimensional array holds the neighbor information</span>
<a name="l00411"></a>00411 <span class="comment">                 * associated with each vertex. mne[p] is a one dimensional</span>
<a name="l00412"></a>00412 <span class="comment">                 * array which holds all of the neighbor information for</span>
<a name="l00413"></a>00413 <span class="comment">                 * vertices of order p. */</span>
<a name="l00414"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#aaa1c991b6f5af826bac0f4c7d5f6bf5c">00414</a>                 <span class="keywordtype">int</span> **<a class="code" href="classvoro_1_1voronoicell__neighbor.html#aaa1c991b6f5af826bac0f4c7d5f6bf5c">mne</a>;<span class="comment"></span>
<a name="l00415"></a>00415 <span class="comment">                /** This is a two dimensional array that holds the neighbor</span>
<a name="l00416"></a>00416 <span class="comment">                 * information associated with each vertex. ne[i] points to a</span>
<a name="l00417"></a>00417 <span class="comment">                 * one-dimensional array in mne[nu[i]]. ne[i][j] holds the</span>
<a name="l00418"></a>00418 <span class="comment">                 * neighbor information associated with the jth edge of vertex</span>
<a name="l00419"></a>00419 <span class="comment">                 * i. It is set to the ID number of the plane that made the</span>
<a name="l00420"></a>00420 <span class="comment">                 * face that is clockwise from the jth edge. */</span>
<a name="l00421"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#a7c061d08eac012b23588032779603a19">00421</a>                 <span class="keywordtype">int</span> **<a class="code" href="classvoro_1_1voronoicell__neighbor.html#a7c061d08eac012b23588032779603a19">ne</a>;
<a name="l00422"></a>00422                 <a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a>();
<a name="l00423"></a>00423                 ~<a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a>();
<a name="l00424"></a>00424                 <span class="keywordtype">void</span> operator=(<a class="code" href="classvoro_1_1voronoicell.html" title="Extension of the voronoicell_base class to represent a Voronoi cell without neighbor information...">voronoicell</a> &amp;c);
<a name="l00425"></a>00425                 <span class="keywordtype">void</span> operator=(<a class="code" href="classvoro_1_1voronoicell__neighbor.html" title="Extension of the voronoicell_base class to represent a Voronoi cell with neighbor information...">voronoicell_neighbor</a> &amp;c);<span class="comment"></span>
<a name="l00426"></a>00426 <span class="comment">                /** Cuts the Voronoi cell by a particle whose center is at a</span>
<a name="l00427"></a>00427 <span class="comment">                 * separation of (x,y,z) from the cell center. The value of rsq</span>
<a name="l00428"></a>00428 <span class="comment">                 * should be initially set to \f$x^2+y^2+z^2\f$.</span>
<a name="l00429"></a>00429 <span class="comment">                 * \param[in] (x,y,z) the normal vector to the plane.</span>
<a name="l00430"></a>00430 <span class="comment">                 * \param[in] rsq the distance along this vector of the plane.</span>
<a name="l00431"></a>00431 <span class="comment">                 * \param[in] p_id the plane ID (for neighbor tracking only).</span>
<a name="l00432"></a>00432 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00433"></a>00433 <span class="comment">                 * true otherwise. */</span>
<a name="l00434"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#a1f0d64e7c42503ada9204cfaeb61027f">00434</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell__neighbor.html#a1f0d64e7c42503ada9204cfaeb61027f">nplane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rsq,<span class="keywordtype">int</span> p_id) {
<a name="l00435"></a>00435                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,p_id);
<a name="l00436"></a>00436                 }<span class="comment"></span>
<a name="l00437"></a>00437 <span class="comment">                /** This routine calculates the modulus squared of the vector</span>
<a name="l00438"></a>00438 <span class="comment">                 * before passing it to the main nplane() routine with full</span>
<a name="l00439"></a>00439 <span class="comment">                 * arguments.</span>
<a name="l00440"></a>00440 <span class="comment">                 * \param[in] (x,y,z) the vector to cut the cell by.</span>
<a name="l00441"></a>00441 <span class="comment">                 * \param[in] p_id the plane ID (for neighbor tracking only).</span>
<a name="l00442"></a>00442 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00443"></a>00443 <span class="comment">                 *         true otherwise. */</span>
<a name="l00444"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#a29264507d9f65efdb2bde573d48aa0c3">00444</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell__neighbor.html#a29264507d9f65efdb2bde573d48aa0c3">nplane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">int</span> p_id) {
<a name="l00445"></a>00445                         <span class="keywordtype">double</span> rsq=x*x+y*y+z*z;
<a name="l00446"></a>00446                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,p_id);
<a name="l00447"></a>00447                 }<span class="comment"></span>
<a name="l00448"></a>00448 <span class="comment">                /** This version of the plane routine just makes up the plane</span>
<a name="l00449"></a>00449 <span class="comment">                 * ID to be zero. It will only be referenced if neighbor</span>
<a name="l00450"></a>00450 <span class="comment">                 * tracking is enabled.</span>
<a name="l00451"></a>00451 <span class="comment">                 * \param[in] (x,y,z) the vector to cut the cell by.</span>
<a name="l00452"></a>00452 <span class="comment">                 * \param[in] rsq the modulus squared of the vector.</span>
<a name="l00453"></a>00453 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00454"></a>00454 <span class="comment">                 *         true otherwise. */</span>
<a name="l00455"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#ab71c4487bbca2d20b00e9af2fc6d1ed0">00455</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell__neighbor.html#ab71c4487bbca2d20b00e9af2fc6d1ed0">plane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z,<span class="keywordtype">double</span> rsq) {
<a name="l00456"></a>00456                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,0);
<a name="l00457"></a>00457                 }<span class="comment"></span>
<a name="l00458"></a>00458 <span class="comment">                /** Cuts a Voronoi cell using the influence of a particle at</span>
<a name="l00459"></a>00459 <span class="comment">                 * (x,y,z), first calculating the modulus squared of this</span>
<a name="l00460"></a>00460 <span class="comment">                 * vector before passing it to the main nplane() routine. Zero</span>
<a name="l00461"></a>00461 <span class="comment">                 * is supplied as the plane ID, which will be ignored unless</span>
<a name="l00462"></a>00462 <span class="comment">                 * neighbor tracking is enabled.</span>
<a name="l00463"></a>00463 <span class="comment">                 * \param[in] (x,y,z) the vector to cut the cell by.</span>
<a name="l00464"></a>00464 <span class="comment">                 * \return False if the plane cut deleted the cell entirely,</span>
<a name="l00465"></a>00465 <span class="comment">                 *         true otherwise. */</span>
<a name="l00466"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#a8bac2d46226b8dbb88ad3e3d58d10cf7">00466</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classvoro_1_1voronoicell__neighbor.html#a8bac2d46226b8dbb88ad3e3d58d10cf7">plane</a>(<span class="keywordtype">double</span> x,<span class="keywordtype">double</span> y,<span class="keywordtype">double</span> z) {
<a name="l00467"></a>00467                         <span class="keywordtype">double</span> rsq=x*x+y*y+z*z;
<a name="l00468"></a>00468                         <span class="keywordflow">return</span> nplane(*<span class="keyword">this</span>,x,y,z,rsq,0);
<a name="l00469"></a>00469                 }
<a name="l00470"></a>00470                 <span class="keywordtype">void</span> init(<span class="keywordtype">double</span> xmin,<span class="keywordtype">double</span> xmax,<span class="keywordtype">double</span> ymin,<span class="keywordtype">double</span> ymax,<span class="keywordtype">double</span> zmin,<span class="keywordtype">double</span> zmax);
<a name="l00471"></a>00471                 <span class="keywordtype">void</span> init_octahedron(<span class="keywordtype">double</span> l);
<a name="l00472"></a>00472                 <span class="keywordtype">void</span> init_tetrahedron(<span class="keywordtype">double</span> x0,<span class="keywordtype">double</span> y0,<span class="keywordtype">double</span> z0,<span class="keywordtype">double</span> x1,<span class="keywordtype">double</span> y1,<span class="keywordtype">double</span> z1,<span class="keywordtype">double</span> x2,<span class="keywordtype">double</span> y2,<span class="keywordtype">double</span> z2,<span class="keywordtype">double</span> x3,<span class="keywordtype">double</span> y3,<span class="keywordtype">double</span> z3);
<a name="l00473"></a>00473                 <span class="keywordtype">void</span> check_facets();
<a name="l00474"></a>00474                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> neighbors(vector&lt;int&gt; &amp;v);
<a name="l00475"></a>00475                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> print_edges_neighbors(<span class="keywordtype">int</span> i);
<a name="l00476"></a><a class="code" href="classvoro_1_1voronoicell__neighbor.html#a2b212f8abaf92200e8ee4b5eee0e60d1">00476</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classvoro_1_1voronoicell__neighbor.html#a2b212f8abaf92200e8ee4b5eee0e60d1">output_neighbors</a>(FILE *fp=stdout) {
<a name="l00477"></a>00477                         vector&lt;int&gt; v;neighbors(v);
<a name="l00478"></a>00478                         voro_print_vector(v,fp);
<a name="l00479"></a>00479                 }
<a name="l00480"></a>00480         <span class="keyword">private</span>:
<a name="l00481"></a>00481                 <span class="keywordtype">int</span> *paux1;
<a name="l00482"></a>00482                 <span class="keywordtype">int</span> *paux2;
<a name="l00483"></a>00483                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_allocate(<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> m) {mne[i]=<span class="keyword">new</span> <span class="keywordtype">int</span>[m*i];}
<a name="l00484"></a>00484                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_add_memory_vertices(<span class="keywordtype">int</span> i) {
<a name="l00485"></a>00485                         <span class="keywordtype">int</span> **pp(<span class="keyword">new</span> <span class="keywordtype">int</span>*[i]);
<a name="l00486"></a>00486                         <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;current_vertices;j++) pp[j]=ne[j];
<a name="l00487"></a>00487                         <span class="keyword">delete</span> [] ne;ne=pp;
<a name="l00488"></a>00488                 }
<a name="l00489"></a>00489                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_add_memory_vorder(<span class="keywordtype">int</span> i) {
<a name="l00490"></a>00490                         <span class="keywordtype">int</span> **p2(<span class="keyword">new</span> <span class="keywordtype">int</span>*[i]);
<a name="l00491"></a>00491                         <span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;current_vertex_order;j++) p2[j]=mne[j];
<a name="l00492"></a>00492                         <span class="keyword">delete</span> [] mne;mne=p2;
<a name="l00493"></a>00493                 }
<a name="l00494"></a>00494                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_pointer(<span class="keywordtype">int</span> p,<span class="keywordtype">int</span> n) {
<a name="l00495"></a>00495                         ne[p]=mne[n]+n*mec[n];
<a name="l00496"></a>00496                 }
<a name="l00497"></a>00497                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b,<span class="keywordtype">int</span> c,<span class="keywordtype">int</span> d) {ne[a][b]=ne[c][d];}
<a name="l00498"></a>00498                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b,<span class="keywordtype">int</span> c) {ne[a][b]=c;}
<a name="l00499"></a>00499                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_aux1(<span class="keywordtype">int</span> k) {paux1=mne[k]+k*mec[k];}
<a name="l00500"></a>00500                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_aux1(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {paux1[b]=ne[a][b];}
<a name="l00501"></a>00501                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_aux1_shift(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {paux1[b]=ne[a][b+1];}
<a name="l00502"></a>00502                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_aux2_copy(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {
<a name="l00503"></a>00503                         paux2=mne[b]+b*mec[b];
<a name="l00504"></a>00504                         <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;b;i++) ne[a][i]=paux2[i];
<a name="l00505"></a>00505                 }
<a name="l00506"></a>00506                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_pointer(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b) {ne[a]=ne[b];}
<a name="l00507"></a>00507                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_to_aux1(<span class="keywordtype">int</span> j) {ne[j]=paux1;}
<a name="l00508"></a>00508                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_to_aux2(<span class="keywordtype">int</span> j) {ne[j]=paux2;}
<a name="l00509"></a>00509                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_allocate_aux1(<span class="keywordtype">int</span> i) {paux1=<span class="keyword">new</span> <span class="keywordtype">int</span>[i*mem[i]];}
<a name="l00510"></a>00510                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_switch_to_aux1(<span class="keywordtype">int</span> i) {<span class="keyword">delete</span> [] mne[i];mne[i]=paux1;}
<a name="l00511"></a>00511                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_copy_to_aux1(<span class="keywordtype">int</span> i,<span class="keywordtype">int</span> m) {paux1[m]=mne[i][m];}
<a name="l00512"></a>00512                 <span class="keyword">inline</span> <span class="keywordtype">void</span> n_set_to_aux1_offset(<span class="keywordtype">int</span> k,<span class="keywordtype">int</span> m) {ne[k]=paux1+m;}
<a name="l00513"></a>00513                 <span class="keyword">friend</span> <span class="keyword">class </span>voronoicell_base;
<a name="l00514"></a>00514 };
<a name="l00515"></a>00515 
<a name="l00516"></a>00516 }
<a name="l00517"></a>00517 
<a name="l00518"></a>00518 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>


<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 23 2011 22:49:06 for Voro++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
